<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <form onsubmit="fn()">
    <input type="text" name="" id="inp">
    <input type="submit" value="" onclick="alert(1111)">
   </form>
  <script>
      var forminp=document.getElementsByTagName("form")[0]
      var inp=document.getElementById("inp")
      inp.onchange=function(){
          console.log(111)
      }
      inp.oninput=function(){
          console.log(111)
      }
    //   forminp.onsubmit=function(){
    //     alert()
    //   }
      function fn(){
        alert(222)
      }
  </script>
</body>
</html>